#include "stm32f10x.h"
#include "hal.h"
#include "Q_Shell.h"

void BEEP_Init(void)
{
	GPIO_InitTypeDef GPIO_InitStructure;

	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);	
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(GPIOA, &GPIO_InitStructure);
	Tim3_Init();
	Tim2_Init();
}

void BEEP_TickOn(void)
{
	Tim2_Set(1000,100,TRUE);	
}
QSH_FUN_REG(BEEP_TickOn,"void BEEP_TickOn(void)");

void BEEP_TickOff(void)
{
	Tim2_Set(0,0,TRUE);	 
	TIM_Cmd(TIM3, DISABLE);
}
QSH_FUN_REG(BEEP_TickOff,"void BEEP_TickOff(void)");

void BEEP_AlwaysOn(void)
{
	Tim2_Set(0,0,TRUE);
	TIM_Cmd(TIM3, ENABLE);
		
}
QSH_FUN_REG(BEEP_AlwaysOn,"void BEEP_AlwaysOn(void)");

void BEEP_AlwaysOff(void)
{
	Tim2_Set(0,0,TRUE);
	TIM_Cmd(TIM3, DISABLE);
}
QSH_FUN_REG(BEEP_AlwaysOff,"void BEEP_AlwaysOff(void)");






